package com.example.mooctao.util;

import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.ViewModel;

import java.util.List;
import java.util.Map;
//首页界面数据的存储和管理
public class IndexViewModel extends ViewModel {
    private final SavedStateHandle savedStateHandle;

    public IndexViewModel(SavedStateHandle savedStateHandle) {
        this.savedStateHandle = savedStateHandle;
    }

    public void setData(List<Map<String, Object>> data) {
        savedStateHandle.set("data", data);
    }

    public List<Map<String, Object>> getData() {
        return savedStateHandle.get("data");
    }

    public void setData1(List<Map<String, Object>> data1) {
        savedStateHandle.set("data1", data1);
    }

    public List<Map<String, Object>> getData1() {
        return savedStateHandle.get("data1");
    }

}